﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aij1.BLL;
using Aij1.Model;
using Aij1.Cms;

namespace Aij1.UserControls
{
    public partial class CtrlNewsMenu : BaseControl
    {
        int categoryId;
        public int CategoryId
        {
            get { return categoryId; }
            set { categoryId = value; }
        }

        public ArticleType CategoryType { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            repCat.DataSource = CategoryData.GetCategorys(XpoSession, CategoryType);
            repCat.DataBind();
        }

        protected int GetCssClassIndex(object oid)
        {
            return (int)oid == CategoryId ? 1 : 2;
        }
    }
}